// components/maintab.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    selected: 0,
    color: "#666",
    selectedColor: "#06ae56",
    list: [
      {
        pagePath: "/pages/index/index",
        text: "首页",
        iconPath: "/images/tabs/home.png",
        selectedIconPath: "/images/tabs/home-active.png"
      },
      {
        pagePath: "/pages/myList/myList",
        text: "我的",
        iconPath: "/images/tabs/user.png",
        selectedIconPath: "/images/tabs/user-active.png"
      }
    ],
    adminList: [
      {
        pagePath: "/pages/reviewList/reviewList",
        text: "审核",
        iconPath: "/images/tabs/review.png",
        selectedIconPath: "/images/tabs/review-active.png"
      }
    ]
  },

  /**
   * 组件的方法列表
   */
  methods: {
    switchTab(e) {
      const data = e.currentTarget.dataset
      const url = data.path
      wx.switchTab({url})
      this.setData({
        selected: data.index
      })
    }
  }
})
